package com.ibuonline.b2b.entity;

import java.io.Serializable;

import com.ibuonline.b2b.common.SysCache;

public class CmsHotProduct implements Serializable {

	private static final long serialVersionUID = -898853739614639767L;

	//fields
	private java.lang.Integer id;
	private java.lang.Long prodId;
	private java.lang.String prodName;
	private java.lang.String mainPicture;
	private java.lang.Integer companyId;
	private java.lang.String companyName;
	private java.lang.Integer clickCount;
	private java.sql.Timestamp createTime;

	//default constructor
	public CmsHotProduct() {
	}

	//getter
	public java.lang.Integer getId() {
		return id;
	}
	public java.lang.Long getProdId() {
		return prodId;
	}
	public java.lang.String getProdName() {
		return prodName;
	}
	public java.lang.String getMainPicture() {
		return mainPicture;
	}
	public java.lang.Integer getCompanyId() {
		return companyId;
	}
	public java.lang.String getCompanyName() {
		return companyName;
	}
	public java.lang.Integer getClickCount() {
		return clickCount;
	}
	public java.sql.Timestamp getCreateTime() {
		return createTime;
	}

	//setter
	public void setId(java.lang.Integer id) {
		this.id = id;
	}
	public void setProdId(java.lang.Long prodId) {
		this.prodId = prodId;
	}
	public void setProdName(java.lang.String prodName) {
		this.prodName = prodName;
	}
	public void setMainPicture(java.lang.String mainPicture) {
		this.mainPicture = mainPicture;
	}
	public void setCompanyId(java.lang.Integer companyId) {
		this.companyId = companyId;
	}
	public void setCompanyName(java.lang.String companyName) {
		this.companyName = companyName;
	}
	public void setClickCount(java.lang.Integer clickCount) {
		this.clickCount = clickCount;
	}
	public void setCreateTime(java.sql.Timestamp createTime) {
		this.createTime = createTime;
	}

	//equals method
	public boolean equals(Object other) {
		if (this == other)
			return true;
		if (!(other instanceof CmsHotProduct))
			return false;

		final CmsHotProduct cmsHotProduct = (CmsHotProduct)other;
		if (!this.id.equals(cmsHotProduct.getId()))
			return false;

		return true;
	}

	//hashCode method
	public int hashCode() {
		StringBuffer keys = new StringBuffer();
		keys.append(id).append(",");
		if (keys.length() > 0)
			keys.deleteCharAt(keys.length() - 1);
		return keys.toString().hashCode();
	}

	//toString method
	public String toString() {
		return new StringBuilder("CmsHotProduct[")
			.append("id=").append(id).append(", ")
			.append("prodId=").append(prodId).append(", ")
			.append("prodName=").append(prodName).append(", ")
			.append("mainPicture=").append(mainPicture).append(", ")
			.append("companyId=").append(companyId).append(", ")
			.append("companyName=").append(companyName).append(", ")
			.append("clickCount=").append(clickCount).append(", ")
			.append("createTime=").append(createTime).append("]").toString();
	}
	public String getShopUserName(){
		return SysCache.getShopDomainByCompanyId(this.companyId);
	}
}